/*
 * @Description: mixin
 * @Author: QiangWei
 * @Date: 2019-12-26 12:16:29
 * @LastEditors  : QiangWei
 * @LastEditTime : 2019-12-26 16:03:05
 */
// 多行文本溢出显示省略号
// -----------------------------------------------------------------------------
@mixin line-clamp($line: 2, $line-height: .38rem) {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: $line;
  -webkit-box-orient: vertical;
  word-break: break-all;
  text-overflow: ellipsis;
  line-height: $line-height;
  max-height: $line-height * $line + .2rem;
}
// 单行文本溢出显示省略号
// -----------------------------------------------------------------------------
@mixin text-overflow($align: justify) {
  word-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  text-align: $align;
}
// 一像素边框
// -----------------------------------------------------------------------------
@mixin top-line($color, $zindex: 0) {
  content: '';
  position: absolute;
  z-index: $zindex;
  top: 0;
  left: 0;
  width: 100%;
  border-top: 1px solid $color;
  -webkit-transform: scaleY(.5);
  transform: scaleY(.5);
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
}

@mixin bottom-line($color, $zindex: 0) {
  content: '';
  position: absolute;
  z-index: $zindex;
  bottom: 0;
  left: 0;
  width: 100%;
  border-bottom: 1px solid $color;
  -webkit-transform: scaleY(.5);
  transform: scaleY(.5);
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
}

@mixin left-line($color, $zindex: 0) {
  content: '';
  position: absolute;
  z-index: $zindex;
  top: 0;
  left: 0;
  height: 100%;
  border-left: 1px solid $color;
  -webkit-transform: scaleX(.5);
  transform: scaleX(.5);
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
}

@mixin right-line($color, $zindex: 0) {
  content: '';
  position: absolute;
  z-index: $zindex;
  top: 0;
  right: 0;
  height: 100%;
  border-right: 1px solid $color;
  -webkit-transform: scaleX(.5);
  transform: scaleX(.5);
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
}